<?php
/**
 *  💡 免责声明：本软件不得用于商业用途，仅做学习交流
 *  ⚠️ 权利声明：本软件由版权人提供产品技术支持
 *  📅 项目编号：NX2025-0135
 */
namespace App\Listeners;

use App\Events\Notify;
use App\Notifications\OrderNotificationTemp;

class OrderNotification
{
    /**
     * Create the event listener.
     */
    public function __construct()
    {
    }

    /**
     * Handle the event.
     *
     * @param \Events\Notify $event
     */
    public function handle(Notify $event)
    {
        if ($event->type == Notify::ORDER) {
            $user = $event->user;
            $msg = $event->msg;
            $res = new OrderNotificationTemp($user, $msg, '订单通知');
            $user->notify($res);
        }
    }
}
